package cn.zyjblogs.server.authority.vo;

import cn.zyjblogs.starter.common.entity.constant.CommonConstant;
import com.alibaba.fastjson2.annotation.JSONField;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author zhuyijun
 */
@ApiModel(description = "权限资源vo对象")
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Data
public class PermissionResourcesVo implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键，uuid
     */
    @ApiModelProperty(value = "主键id")
    private String id;
    /**
     * 权限资源编码
     */
    @ApiModelProperty(value = "编码")
    private String code;

    /**
     * 名称
     */
    @ApiModelProperty(value = "名称")
    private String name;


    /**
     * 父记录主键，uuid
     */
    @ApiModelProperty(value = "父级节点id")
    private String parentId;
    /**
     * 资源类型 0页面 1 按钮
     */
    @ApiModelProperty(value = "资源类型 0 页面 1 按钮")
    private Integer resourceType;

    /**
     * 描述
     */
    @ApiModelProperty(value = "描述")
    private String description;

    /**
     * 前端是否可见：0 隐藏，1 显示
     */
    @ApiModelProperty(value = "前端是否可见 0 显示 1 隐藏")
    private Integer uiShow;

    /**
     * 前端用路径
     */
    @ApiModelProperty(value = "前端用路径")
    private String uiPath;

    /**
     * 前端用编码
     */
    @ApiModelProperty(value = "前端用编码")
    private String uiCode;

    /**
     * 前端用排序
     */
    @ApiModelProperty(value = "前端用排序")
    private Integer uiSort;

    /**
     * 前端用模板
     */
    @ApiModelProperty(value = "前端模板")
    private String uiTemplate;
    /**
     * 前端面包屑，1显示 0不显示
     */
    @ApiModelProperty(value = "前端面包屑，1显示 0不显示")
    private Integer uiIsShowBreadcrumb;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JSONField(format = CommonConstant.DATETIME_PATTERN)
    private LocalDateTime createTime;

    /**
     * 最后修改的时间
     */
    @ApiModelProperty(value = "最后修改的时间")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JSONField(format = CommonConstant.DATETIME_PATTERN)
    private LocalDateTime editTime;

}
